package com.vip.jwt.entity;

import com.baomidou.mybatisplus.annotation.*;
import lombok.Data;

import java.time.LocalDateTime;
import java.util.Date;

@Data
public class User {

    private String id;

    @TableField(updateStrategy = FieldStrategy.IGNORED) //使该字段可以更新置空
    private String name;

    @TableField(fill = FieldFill.INSERT)
    private Date createTime;

    @TableField(fill = FieldFill.INSERT_UPDATE)
    private Date updateTime;

    /**
     * @Version 注解的作用是使version字段每次更新数据时+1，并且加上where条件，例如：where version=2
     */
    @TableField(fill = FieldFill.INSERT)
    @Version
    private Integer version;

    /**
     * 0代表未删除、1代表删除
     */
    @TableField(fill = FieldFill.INSERT)
    private Integer deleted;

}
